import { createApp } from 'vue'
import App from './App.vue'
import router from '@/router'
// import '@/router/initDynamicRouter'
import store from '@/store/modules/user'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
// 引入 Element Plus 的中文语言包
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import {useStore} from "vuex";
const app = createApp(App)

for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    if (['Menu', 'SwitchButton', 'Calendar'].includes(key)) {
        app.component(key + 's', component)
    } else {
        app.component(key, component)
    }
}

app.use(router)
    .use(ElementPlus, {
        locale: zhCn,
    })
    .use(store)
app.mount('#app')
